
<div class="uk-grid">
    <div class="uk-width-3-4@l">

        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header">
                <div class="dux-topic-header">
                    <h1>{$info.title}</h1>
                    <div class="info">
                        <a href="">
                            <i class="fa fa-folder"></i>
                            {$info.node_name}
                        </a>
                        <span class="separ">⋅</span>
                        <a href="#">{$info.show_name}</a>
                        <span class="separ">⋅</span>
                        于 <span>{date_tran($info.create_time)}</span>
                        <!--if{$replyInfo}-->
                        <span class="separ">⋅</span>
                        最后回复由
                        <a href="#">{$replyInfo.show_name}</a>
                        于 <span>{date_tran($replyInfo.create_time)}</span>
                        <!--{/if}-->
                        <span class="separ">⋅</span>
                        {$info.views} 阅读

                    </div>
                </div>

            </div>
            <div class="uk-card-body dux-topic-body markdown-body">
                <div class="markdown-body">
                    {$contentInfo.html}
                </div>
            </div>
            <div class="dux-topic-footer uk-text-right">
                <div class="footer-tools">
                    <!--if{$info['user_id'] == USER_ID || in_array(USER_ID, $manageIds)}-->
                    <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-title="您确认要删除本主题吗？" data-url="{url('topics/DetailManage/del', ['id' => $info.detail_id])}" data-callback="returnUrl" uk-tooltip="删除主题"><i class="fa fa-trash"></i></a>
                    <!--{/if}-->
                    <!--if{USER_ID && in_array(USER_ID, $manageIds)}-->
                    <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-title="{$info.attr_excellent ? '您确认要取消精华主题吗？' : '您确认要加精本主题吗？'}" data-url="{url('topics/DetailManage/excellent', ['id' => $info.detail_id])}" uk-tooltip="精华主题"><i class="fa fa-star {$info.attr_excellent ? 'uk-text-danger' : ''}"></i></a>
                    <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-title="您确认要置顶本主题吗？" data-url="{url('topics/DetailManage/top', ['id' => $info.detail_id])}" uk-tooltip="置顶主题"><i class="fa fa-flag  {$info.attr_top ? 'uk-text-danger' : ''}"></i></a>
                    <!--{/if}-->
                </div>
            </div>
        </div>


        <!--if{!empty($answerList)}-->
        <div class="uk-card uk-card-warning">
            <div class="uk-card-header ">
                最佳答案: {count($answerList)}
            </div>
            <ul class="dux-reply-list">
                <!--loop{$answerList as $vo}-->
                <li class="uk-flex">
                    <div class="avatar">
                        <a href="#">
                            <img class="uk-border-circle" alt="daydaygo"
                                 src="{$vo.avatar}"
                                 width="55" height="55">
                        </a>
                    </div>
                    <div class="info">
                        <div class="info-head">
                            <a href="">{$vo.show_name}</a>
                            <!--if{$vo.user_id == $info.user_id}-->
                            <span class="uk-label uk-label-primary">楼主</span>
                            <!--{/if}-->
                            <span class="intro"></span>
                            <span class="operate uk-float-right">
                                <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-title="您确认要删除本回复吗？" data-url="{url('topics/DetailManage/reply', ['id' => $info.detail_id, 'reply_id' => $vo.reply_id])}" uk-tooltip="删除回复"><i class="fa fa-trash"></i></a>
                                <a href="javascript:replyUser('{$vo.show_name}');"  uk-tooltip="回复用户"><i class="fa fa-reply"></i></a>
                            </span>
                        </div>
                        <div class="info-intro">
                            <a href="">#{$vo.floor}</a>
                            <span class="separ">⋅</span>
                            <a href="">{date_tran($vo.create_time)}</a>
                        </div>
                        <div class="info-content markdown-body">
                            {$vo.html}
                        </div>
                    </div>
                </li>
                <!--{/loop}-->
            </ul>
        </div>
        <!--{/if}-->

        <br>
        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header ">
                回复数量: {count($replyList)}
            </div>
            <ul class="dux-reply-list">
                <!--if{empty($replyList)}-->
                <div class="uk-padding uk-text-center">暂时没有回复内容</div>
                <!--{/if}-->
                <!--loop{$replyList as $vo}-->
                <li class="uk-flex">
                    <div class="avatar">
                        <a href="#">
                            <img class="uk-border-circle" alt="daydaygo"
                                 src="{$vo.avatar}"
                                 width="55" height="55">
                        </a>
                    </div>
                    <div class="info uk-flex-1">
                        <div class="info-head">
                            <a href="">{$vo.show_name}</a>
                            <!--if{$vo.user_id == $info.user_id}-->
                            <span class="uk-label uk-label-primary">楼主</span>
                            <!--{/if}-->
                            <span class="intro"></span>
                            <span class="operate uk-float-right">
                                <!--if{USER_ID && in_array(USER_ID, $manageIds)}-->
                                <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-title="您确认要删除本回复吗？" data-url="{url('topics/DetailManage/reply', ['id' => $info.detail_id, 'reply_id' => $vo.reply_id])}" uk-tooltip="删除回复"><i class="fa fa-trash"></i></a>
                                <!--{/if}-->
                                <a href="javascript:replyUser('{$vo.show_name}');"  uk-tooltip="回复用户"><i class="fa fa-reply"></i></a>
                            </span>
                        </div>
                        <div class="info-intro">
                            <a href="">#{$vo.floor}</a>
                            <span class="separ">⋅</span>
                            <a href="">{date_tran($vo.create_time)}</a>
                        </div>
                        <div class="info-content markdown-body">
                            {$vo.html}
                        </div>
                        <div class="uk-text-right">
                            <!--if{$info.user_id == USER_ID}-->
                                <a href="javascript:;" data-dux="dialog-ajaxConfirm" data-url="{url('answer', ['id'=> $info.detail_id, 'reply_id' => $vo.reply_id])}" data-title="确定采纳为正确答案？">采纳</a>
                            <!--{/if}-->
                        </div>
                    </div>
                </li>
                <!--{/loop}-->
            </ul>
        </div>

        <br>
        <form action="{url('topics/reply/index')}" data-dux="form-bind" method="post" class="dux-topic-editor" data-advanced="false"  data-callback="formSubmit">
            <ul class="editor-info">
                <li>请注意单词拼写，以及中英文排版，<a href="https://github.com/sparanoid/chinese-copywriting-guidelines"
                                       target="_blank">参考此页</a>
                </li>
                <li>支持 Markdown 格式, <strong>**粗体**</strong>、~~删除线~~、<code>`单行代码`</code>, 更多语法请见这里 <a
                        href="https://github.com/riku/Markdown-Syntax-CN/blob/master/syntax.md" target="_blank">Markdown
                    语法</a></li>
                <li>上传图片, 需要上传至图床</li>
                <li>发布框支持本地存储功能，会在内容变更时保存，「提交」按钮点击时清空</li>
            </ul>
            <textarea id="editor" name="markdown" data-dux="topics-editor"></textarea>
            <div class="uk-text-right">
                <input type="hidden" name="url" value="topics/Faq/info">
                <input type="hidden" name="detail_id" value="{$info.detail_id}">
                <button type="submit" class="uk-button uk-button-success">回复</button>
            </div>
        </form>
    </div>
    <div class="uk-width-1-4@l">
        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header uk-text-center">
                {$info.show_name}
            </div>
            <div class="uk-card-body uk-text-center">
                <p>
                    <img class="uk-border-circle" width="80" height="80"
                         src="{$info.avatar}" alt="">
                </p>
                <p class="uk-margin-remove-bottom">
                    <a uk-tooltip="{$info.user_email}" class="uk-label "><i
                            class="fa fa-comment"></i> Email</a>
                    <a class="uk-label "><i class="fa fa-location-arrow"></i> {$userInfo.city ? $userInfo.city : '未知'}</a>
                </p>
            </div>
        </div>
        <br>
        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header uk-text-center">
                TA的其他话题
            </div>
            <ul class="dux-side-list">
                <!--loop{$otherList as $vo}-->
                <li class="uk-text-truncate"><a uk-tooltip="{$vo.title}" href="{url('topics/Detail/info', ['id' => $vo.detail_id])}" >{$vo.title}</a></li>
                <!--{/loop}-->
            </ul>
        </div>
        <br>

        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header uk-text-center">
                节点下的其他话题
            </div>
            <ul class="dux-side-list">
                <!--loop{$detailList as $vo}-->
                <li class="uk-text-truncate"><a uk-tooltip="{$vo.title}" href="{url('topics/Detail/info', ['id' => $vo.detail_id])}" >{$vo.title}</a></li>
                <!--{/loop}-->
            </ul>
        </div>
    </div>

</div>
<script>
    Do('editor_md', function () {
        window.returnUrl = function () {
            history.go(-1);
        };
        window.replyUser = function (username) {
            window['editor'].value('@@' + username + '@@ ');

        };
        window.formSubmit = function (msg, url) {
            window['editor'].clearAutosavedValue();
            window.location.href = url;
        };
    });
</script>